package STUDENT.TRANDAODAIVI.THUVIEN.MODELS;
import java.util.LinkedList; 
import STUDENT.TRANDAODAIVI.THUVIEN.IDENTITY.BookInfo;
import STUDENT.TRANDAODAIVI.THUVIEN.IDENTITY.UserInfo;
import STUDENT.TRANDAODAIVI.THUVIEN.IDENTITY.BookInfo;
public class Models1 {
	private LinkedList<BookInfo> library=new LinkedList<BookInfo>();
	
	public void addBooks(BookInfo book){
		library.add(book);
	}
	public void showBooks(){
		System.out.println("Sach hien co trong thu vien: ");
		System.out.println("");
		for(BookInfo book: library){
			System.out.println("ID: "+book.getId());
			System.out.println("Name: "+ book.getName()+" "+"Author: "+book.getAuthor());
		}
	}
	public int checkBook(int id,String name){
		for(BookInfo book:library){
			if(id==book.getId()){
				if(name.equals(book.getName()))
					return 1;
			}
		};
		return -1;
	}
	
	public int getSize(){
		return library.size();
	}
}
